$(function(){
	$(".loginbtn").click(function(){
		var userNo = $('#userNo').val();
		var password = $('#password').val();
		if(userNo==null||userNo==''){
			layer.alert("请输入账号");
			return;
		}
		if(password==null||password==''){
			layer.alert("请输入密码");
			return;
		}
		$.ajax({
			url:contextPath+'/sys/login',
			data:{userNo:userNo,password:password},
			type:'post',
			dataType:'json',
			success:function(data){
				if(data.result){
					self.location.href = contextPath+'/main';
				}else{
					layer.alert(data.msg);
				}
			}
		});
	});
})